home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
pc
/
pm65sdk
/
sourcecode
/
includes
/
iadobevector.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-08
|
12KB
|
311 lines
// ivector.h
// See the IAdobeVector document for detailed information on this interface.
#ifndef __IVECTOR_H
#define __IVECTOR_H
// Define all the stuff we need from the OLE headers used by ivector.h so the OLE
// headers are not required on the Macintosh. This is only supported on the
// Macintosh when using the Metrowerks compiler.
#if !defined(_OLE2_H_) && __MWERKS__ && defined (__cplusplus)
typedef struct
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
// Define DEFINE_GUID_DATA variable in one file to allocate storage for the GUID.
#ifdef DEFINE_GUID_DATA
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern GUID name = { l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8 }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern GUID name
#endif
#define STDMETHOD_(type, method) virtual type method
typedef void *HRESULT;
#define REFIID GUID &
typedef struct tagRECTL
{
long left;
long top;
long right;
long bottom;
} RECTL;
// On the Macintosh 68k Platform, the OLE calling convention requires pointers in DO
// since OLE is based on the MPW calling convention.
// When using the MetroWerks Codewarrior compiler, use its pragma to set this option.
#ifndef __powerc
#pragma pointers_in_D0
#endif
// Define IUnknown so the vtables match OLE's calling convension (MPW calling convension on the Mac).
// SingleObject is built into Metrowerk's Codewarrior compiler.
class IUnknown : public SingleObject {
public:
STDMETHOD_(HRESULT, QueryInterface)(REFIID riid, void **ppvObj) = 0;
STDMETHOD_(unsigned long, AddRef)() = 0;
STDMETHOD_(unsigned long, Release)() = 0;
};
#endif
// RGB color definition used by IAdobeVector::RGBColor
typedef struct {
unsigned short r;
unsigned short g;
unsigned short b;
} AVRGB;
// CMYK color definition used by IAdobeVector::CMYKColor
typedef struct {
unsigned short c;
unsigned short m;
unsigned short y;
unsigned short k;
} AVCMYK;
// Hifi color definition used by IAdobeVector::HifiColor
typedef struct {
unsigned long inkitem[8]; // Associated inks.
unsigned short inklevel[8]; // Dot area coverage of the ink for this color (0-65535).
unsigned short count; // Number of elements in inkitem and inklevel.
unsigned short c;
unsigned short m;
unsigned short y;
unsigned short k;
unsigned short r;
unsigned short g;
unsigned short b;
} AVHIFI;
// File types used by IAdobeVector::FileNeeded.
typedef enum {
AV_TYPE_EPS, // 0
AV_TYPE_OPI_1, // 1
AV_TYPE_DCS, // 2
AV_TYPE_OTHER, // 3
AV_TYPE_OPI_2 // 4
} AVFileNeededType;
// Type of PostScript to generate. Used by AV_STATE_INFO.
typedef enum {
AV_TYPE_COMPOSITE, // 0, Generate composite data.
AV_TYPE_SEPARATION, // 1, Generate separation data.
AV_TYPE_INRIPSEP, // 2, Generate in-rip separation data.
AV_TYPE_ALL // 3, Generate all data.
} AVStateType;
// Type of PostScript to generate for bitmap data. Used by AV_STATE_INFO.
typedef enum {
AV_BITMAP_HIGHRES, // 0, Generate high-res bitmap data.
AV_BITMAP_LOWRES, // 1, Generate low-res bitmap data.
AV_BITMAP_NONE // 2, Do not generate any bitmap data.
} AVStateBitmapType;
// This defines the current state. It is used by IAdobeVector::DownloadPostScript and it
// determines what PostScript gets generated.
typedef struct {
AVStateType type; // Type of PostScript to generate.
AVStateBitmapType bitmaptype; // Type of bitmap data to generate.
char *platecolor; // Pointer to a color name. 0 when type does not equal AV_TYPE_SEPARATION.
// unsigned long ink; // Ink to use when generating bitmap data.
// BOOL binaryimagedata; // When TRUE, generate binary image date, otherwise generate ASCII image data.
// BOOL pageindependence; // When TRUE, generate page independent data.
// BOOL extraimagebleed;
// BOOL grayscale; // When TRUE, generate grayscale information for color image data, otherwise
// print colors as black.
// BOOL mirror; // When TRUE, generate mirror image.
// BOOL negative; // When TRUE, generate image data in negative.
// BOOL preserveepscolors;
} AV_STATE_INFO;
// Return codes from IAdobeVector methods.
typedef enum {
AV_SUCCESS, // 0
AV_INVALID_ITEM_NUMBER, // 1
AV_BUFFER_TOO_SMALL, // 2
AV_INVALID_PARAMETER, // 3
AV_DRAW_STOPPED_EARLY, // 4
AV_OUT_OF_MEMORY, // 5
AV_SYSTEM_ERROR, // 6
AV_NOT_SUPPORTED, // 7
AV_OPEN_ERROR, // 8
AV_READ_ERROR, // 9
AV_FILE_NOT_FOUND, // 10
AV_WRITE_ERROR // 11
} AVRC; // Adobe Vector Return Code
// This is the definition of the callback routine used by IAdobeVector::DownloadPostScript.
// All the PostScript generated gets sent to this routine.
// The pData parameter points to a buffer containing the PostScript.
// The length parameter is the length of the data in the buffer.
// The pExtra parameter is IAdobeVector::DownloadPostScript's extra parameter.
typedef AVRC AV_PROCESS_DATA(char *pData, unsigned long length, void *pExtra);
// This is the device used by the IAdobeVector::Draw method.
#ifndef WIN32
typedef GrafPtr AV_DEVICE;
#else
typedef HDC AV_DEVICE;
#endif
#ifdef __cplusplus
// On the Macintosh 68k Platform, the OLE calling convention requires pointers in DO
// since OLE is based on the MPW calling convention.
// When using the MetroWerks Codewarrior compiler, use its pragma to set this option.
#if !defined(__powerc) && defined(__MWERKS__)
#pragma pointers_in_D0
#endif
// {9C73C430-6C8E-11cf-8F20-0020AFE7735C}
DEFINE_GUID(IID_IAdobeVector, 0x9c73c430, 0x6c8e, 0x11cf, 0x8f, 0x20, 0x0, 0x20, 0xaf, 0xe7, 0x73, 0x5c);
class IAdobeVector : public IUnknown {
public:
STDMETHOD_(HRESULT, QueryInterface)(REFIID riid, void **ppvObj) = 0;
STDMETHOD_(unsigned long, AddRef)() = 0;
STDMETHOD_(unsigned long, Release)() = 0;
STDMETHOD_(AVRC, Draw)(AV_DEVICE device, RECTL *lprcBounds, unsigned long highres, int (* pfnContinue)(unsigned long), unsigned long dwContinue) = 0;
STDMETHOD_(AVRC, GetBoundingBox)(unsigned long *llx, unsigned long *lly, unsigned long *urx, unsigned long *ury) = 0;
STDMETHOD_(AVRC, FontNeeded)(unsigned long item, char *name, unsigned short size) = 0;
STDMETHOD_(AVRC, FontSupplied)(unsigned long item, char *name, unsigned short size) = 0;
STDMETHOD_(AVRC, HifiColor)(unsigned long item, char *name, unsigned short size, AVHIFI *pHifi) = 0;
STDMETHOD_(AVRC, Ink)(unsigned long item, char *name, unsigned short size, unsigned short *pNeutralDensity) = 0;
STDMETHOD_(AVRC, ProcessColorsUsed)(int *pCyan, int *pMagenta, int *pYellow, int *pBlack) = 0;
STDMETHOD_(AVRC, RGBColor)(unsigned long item, char *name, unsigned short size, AVRGB *pRgb) = 0;
STDMETHOD_(AVRC, CMYKColor)(unsigned long item, char *name, unsigned short size, AVCMYK *pCmyk, int *pSpot) = 0;
STDMETHOD_(AVRC, FileNeeded)(unsigned long item, char *filename, unsigned short size, AVFileNeededType *type) = 0;
STDMETHOD_(AVRC, ChangeFilename)(unsigned long item, char *filename) = 0;
STDMETHOD_(AVRC, DownloadPostScript)(AV_STATE_INFO *pState, AV_PROCESS_DATA *pProcessData, void *extra) = 0;
};
#if !defined(__powerc) && defined(__MWERKS__)
#pragma pointers_in_A0
#endif
#endif
// PageMaker specific stuff
#ifdef _PAGEMAKE
#ifdef __cplusplus
/*
Create and return an IAdobeVector interface pointer. Create it from the data
associated with the S_PSCRIPT segment (the lpSeg parameter). The pFCRec parameter
specifies the publication where the segment exists, pass 0 to use the
current publication. The IAdobeVector interface pointer for the segment
is returned in the pAV parameter.
The pPreviewTID and pPreviewType parameters are optionally returned with the preview data
and its type. The possible types are S_METAFILE, S_MACPICT, and S_BITMAP. When the associated
EPS file does not contain a preview, this routine will create one. pPreviewTID and
pPreviewType are optional, pass 0 when they are not needed.
When done with the IAdobeVector interface, the caller must call the IAdobeVector
Release method to free memory used.
*/
RC CreateAdobeVector(FCREC *pFCRec, LPSEGMENT lpSeg, WORD *fileKind, IAdobeVector **pAV);
RC CreateAdobeVector(FCREC *pFCRec, TID tid, FILESPEC *pFileSpec, TID *pPreview, BYTE *pPreviewType,WORD *fileKind, IAdobeVector **pAV);
/*
Get the filespec associated with the given segment. If the file is stored in a
publication table, a special table filespec is returned, otherwise
the filespec to the external file is returned.
*/
RC GetEpsFileSpec(FCREC *pFCRec, LPSEGMENT lpSeg, FILESPEC *pFileSpec, FILESPEC *pExternalSpec);
/*
Create a filespec from a name string. The name format can be in either platform's style.
The name can be a full path name or just the name part. When only the name is specified,
or the path is in the wrong format for this platform, the DefaultFileSpec's path is used with
the name to create the new filespec. pFound is returned true when the file exists.
pFound is optional, pass 0 when this information is not needed.
*/
RC CreateFileSpecFromName(FILESPEC *DefaultFileSpec, char *name, FILESPEC *NewFileSpec, BOOL *pFound);
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
Return file kind of the file in this segment
*/
WORD FindFileKindofEPSSeg(FCREC *pFCRec, LPSEGMENT lpSeg);
/*
Convert 6.0 Eps private data to 5.0 private data. The tid parameter is a table of private
data in 6.0 format. A new table is created and returned in the newTID parameter.
*/
RC ConvertEps6To5(PFCB pFCB, TID tid, PFCB pNewFCB, TID *newTID);
/*
Convert 5.0 Eps private data to 6.0 private data. The tid parameter is a table of private
data in 5.0 format. A new table is created and returned in the newTID parameter.
*/
RC ConvertEps5To6(PFCB pFCB, TID tid, PFCB pNewFCB, TID *newTID);
#if defined (DEBUG) || defined(_DEBUG)
/*
Call this to test this implementation of IAdobeVector.
*/
RC TestAdobeVector();
/*
This routine appends the given eps private data (pFCRec and tid) to the end of the given
test file (testfile) in a format that the CreateTestTable routine can read. The format
parameter is 5 or 6 depending on the private data format. The filespec parameter is the filespec of
the associated EPS file.
*/
RC AppendToTestFile(FCREC *pFCRec, TID tid, WORD format, FILESPEC *filespec);
RC AppendToFile(char *testfile, FCREC *pFCRec, TID tid, WORD format, FILESPEC *filespec);
/*
This routine creates a table used with CreateAdobeVector. It creates the table by reading the
data from the test file provided. The test file can have several images in it and the item parameter
specifies which one to use (0 first, 1 second, etc). The tid, format and filespec parameters
are filled in.
*/
RC CreateTestTable(char *testfile, int item, FCREC *pFCRec, TID *pTid, WORD *pFormat, FILESPEC *filespec);
/*
Compare the given filename path part with the given pfs path part.
Compare the given filename name part with the comparestring.
Return non-zero when they don't match. The pfs and comparestring parameters are optional, pass 0
to skip the compare.
*/
unsigned long CompareFilenameParts(FILESPEC *pfs, char *filename, char *comparestring);
RC CheckVectorHeader(BOOL quite);
#endif
#ifdef __cplusplus
}
#endif
#endif
#endif